package cn.hefan.web.servlet.cominf;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fasterxml.jackson.databind.ObjectMapper;

import cn.hefan.domain.Cominf;
import cn.hefan.service.CominfService;

public class CominfServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
			Cominf cominf= CominfService.Select();
			ObjectMapper mapper = new ObjectMapper();
			response.setContentType("application/json;charset=utf-8");
			mapper.writeValue(response.getOutputStream(),cominf);
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}

}